<style>
    .Zi--EyeSlash {
        display: none;
    }
    
    .Login-options {
        margin-top: 12px;
        height: 20px;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-pack: justify;
        -ms-flex-pack: justify;
        justify-content: space-between;
        background: #fff;
    }
    
    .Button--link,
    .Button--plain {
        height: auto;
        padding: 0;
        line-height: inherit;
        background-color: transparent;
        border: none;
        border-radius: 0;
        color: #8590a6;
        cursor: pointer;
    }
</style>

<div class="main">
    <div class="main_bg">
        <div class="loginBox">
            <div class="my-logo">
                <a href="/"><img src="/Public/common/img/logo_06.png" width="130"></a>
            </div>
            <!-- signContent -->
            <div class="signContent">
                <div class="signContainer">
                    <form action="" class="loginForm" id="form_key" data-module="smsFrom" onsubmit="return checkForm()">
                        <!-- tab -->
                        <div class="tabBox">
                            <div class="tabBoxSwitch">
                                <ul class="tabBoxSwitchUl">
                                    <li class="tab-active" data-id="0">微信登录</li>
                                </ul>
                                <div class="ercode_tab swicth-ercode" style="width:100px;top:19px;font-size: 16px;">
                                    <a href="/"><i class="layui-icon layui-icon-return"></i> 返回主页</a>
                                </div>
                            </div>
                        </div>
                        <!-- tabContent -->
                        <div class="tabContent">
                            <div class="login_wechat" style="height: 270px;margin-top:40px;margin-bottom:20px;" id="login_container"></div>
                        </div>
                        <div class="SignContainer-tip">
                            <div>
                                <div>未注册手机验证后自动登录，注册即代表同意<a href="javascript:openArticle('溪语编程使用协议',100014);">《溪语编程使用协议》</a><a href="javascript:openArticle('隐私保护指引',100013);">《隐私保护指引》</a></div>
                            </div>
                        </div>
                    </form>
                    <!-- ercodeSgin -->
                    <div class="ercodeSignBox">
                        <div class="ercode_tab switch-input">
                            <svg width="52" height="52" xmlns:xlink="http://www.w3.org/1999/xlink" fill="currentColor">
                                <defs>
                                    <path id="id-14580708-a" d="M0 0h48a4 4 0 0 1 4 4v48L0 0z"></path>
                                </defs>
                                <g fill="none" fill-rule="evenodd">
                                    <mask id="id-14580708-b" fill="#fff">
                                        <use xlink:href="#id-14580708-a"></use>
                                    </mask>
                                    <use fill="#0084FF" xlink:href="#id-14580708-a"></use>
                                    <path fill="#FFF"
                                        d="M22.125 4h13.75A4.125 4.125 0 0 1 40 8.125v27.75A4.125 4.125 0 0 1 35.875 40h-13.75A4.125 4.125 0 0 1 18 35.875V8.125A4.125 4.125 0 0 1 22.125 4zm6.938 34.222c1.139 0 2.062-.945 2.062-2.11 0-1.167-.923-2.112-2.063-2.112-1.139 0-2.062.945-2.062 2.111 0 1.166.923 2.111 2.063 2.111zM21 8.333v24h16v-24H21z"
                                        mask="url(#id-14580708-b)"></path>
                                    <g mask="url(#id-14580708-b)">
                                        <path fill="#FFF"
                                            d="M46.996 15.482L39 19.064l-7.996-3.582A1.6 1.6 0 0 1 32.6 14h12.8a1.6 1.6 0 0 1 1.596 1.482zM47 16.646V24.4a1.6 1.6 0 0 1-1.6 1.6H32.6a1.6 1.6 0 0 1-1.6-1.6v-7.754l8 3.584 8-3.584z">
                                        </path>
                                        <path fill="#0084FF" d="M31 15.483v1.17l8 3.577 8-3.577v-1.17l-8 3.581z"
                                            fill-rule="nonzero"></path>
                                    </g>
                                </g>
                            </svg>
                        </div>
                        <!-- ercodeConent -->
                        <div class="ercodeContent">
                            <div class="Qrcode-title">扫码登录</div>
                            <div class="ercodeBox">
                                <div class="Qrcode-img" id="qrcode">
                                    <!-- <img width="150" height="150" src="../img/image.png" alt="二维码"> -->
                                </div>
                                <p>打开<a href="#" target="_blank" rel="noopener noreferrer">
                                        溪语编程小程序</a></p>
                                <p>在「我的」页面右上角打开扫一扫</p>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
            <!--  -->
            <div class="css-1hmxk26"></div>
        </div>
    </div>
</div>
<php>$weixinConfig = C('weixin_web');</php>
<script src="/Public/common/js/wxLogin.js"></script>
<script>
    var obj = new WxLogin({
        self_redirect: false,
        id: "login_container",
        appid: "{$weixinConfig['appid']}",
        scope: "snsapi_login",
        redirect_uri: "{:C('Home_URL')}/user/weixin/login_webjs_callback",
        state: "state",
        style: "black",
        href: "data:text/css;base64,LmltcG93ZXJCb3ggLnFyY29kZSB7d2lkdGg6IDIwMHB4O30NCi5pbXBvd2VyQm94IC50aXRsZSB7ZGlzcGxheTogbm9uZTt9DQouaW1wb3dlckJveCAuaW5mbyB7d2lkdGg6IDIwMHB4O30NCi5zdGF0dXNfaWNvbiB7ZGlzcGxheTpub25lfQ0KLmltcG93ZXJCb3ggLnN0YXR1cyB7dGV4dC1hbGlnbjogY2VudGVyO30NCi5pbXBvd2VyQm94IC5zdGF0dXMgcDpsYXN0LWNoaWxkIHtkaXNwbGF5Om5vbmU7fQ=="
    });
    is_weixin();

    function is_weixin() {
        var ua = window.navigator.userAgent.toLowerCase();
        if (ua.match(/MicroMessenger/i) == 'micromessenger') {
            // location.href = "/user/weixin/login";
            // alert('微信浏览器');
            window.location.href = "/user/weixin/login";
        } else {
            // console.log("不是微信浏览器");
        }
    }
</script>